<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>STAPpp: /Users/xzhang/git/FEM-Projects/STAPpp/src/h/Element.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">STAPpp
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">STAPpp is a C++ finite element method (FEM) code whose input/output data files are the same as STAP90.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_91e09e7569ccd19553b6fd3d442a4b1c.html">h</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Element.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_element_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">/*  STAP++ : A C++ FEM code sharing the same input data file with STAP90     */</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/*     Computational Dynamics Laboratory                                     */</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">/*     School of Aerospace Engineering, Tsinghua University                  */</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">/*                                                                           */</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">/*     Release 1.0, October 14, 2017                                         */</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">/*                                                                           */</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/*     http://www.comdyn.cn/                                                 */</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_node_8h.html">Node.h</a>&quot;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_material_8h.html">Material.h</a>&quot;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_skyline_matrix_8h.html">SkylineMatrix.h</a>&quot;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">class </span><a class="code" href="class_c_domain.html">CDomain</a>;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> type&gt; <span class="keywordtype">void</span> <a class="code" href="_element_8h.html#ad85a06b63ba0fed5a7812531d8ee94c3">clear</a>( type* a, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> N );    <span class="comment">// Clear an array</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_c_element.html">   31</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_element.html">CElement</a></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;{</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_c_element.html#ad098d15aca943b13da14ec88fba7aaa5">   36</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_element.html#ad098d15aca943b13da14ec88fba7aaa5">NEN</a>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="class_c_element.html#a049aa63089d5133dbf97b9fe8b45986b">   39</a></span>&#160;    <a class="code" href="class_c_node.html">CNode</a>** <a class="code" href="class_c_element.html#a049aa63089d5133dbf97b9fe8b45986b">nodes</a>;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_c_element.html#a2a066cabbbfda053188bf43e11794581">   42</a></span>&#160;    <a class="code" href="class_c_material.html">CMaterial</a>* <a class="code" href="class_c_element.html#a2a066cabbbfda053188bf43e11794581">ElementMaterial</a>; </div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    </div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="class_c_element.html#affc6f37cca3dcee2432f8525c28727ee">   45</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>* <a class="code" href="class_c_element.html#affc6f37cca3dcee2432f8525c28727ee">LocationMatrix</a>;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="class_c_element.html#a1c23c9c0a89413a25271ef4228c3cc56">   48</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_element.html#a1c23c9c0a89413a25271ef4228c3cc56">ND</a>;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_c_element.html#a1bea8a7fd6a8c1529b7bd41f34bd8edf">   53</a></span>&#160;    <a class="code" href="class_c_element.html#a1bea8a7fd6a8c1529b7bd41f34bd8edf">CElement</a>() : NEN(0), nodes(NULL), ElementMaterial(NULL) {};</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Read(ifstream&amp; Input, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Ele, <a class="code" href="class_c_material.html">CMaterial</a>* MaterialSets, <a class="code" href="class_c_node.html">CNode</a>* NodeList) = 0;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> Write(ofstream&amp; OutputFile, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Ele) = 0;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">//  Caution:  Equation number is numbered from 1 !</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> GenerateLocationMatrix() = 0;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">void</span> CalculateColumnHeight(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>* ColumnHeight); </div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordtype">void</span> assembly(<span class="keywordtype">double</span>* Matrix, <a class="code" href="class_c_skyline_matrix.html">CSkylineMatrix&lt;double&gt;</a>* StiffnessMatrix);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> ElementStiffness(<span class="keywordtype">double</span>* stiffness) = 0; </div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> ElementStress(<span class="keywordtype">double</span>* stress, <span class="keywordtype">double</span>* Displacement) = 0;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_c_element.html#a9a13dc46d9eba3a1ecf2677da7d45465">   78</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="class_c_node.html">CNode</a>** <a class="code" href="class_c_element.html#a9a13dc46d9eba3a1ecf2677da7d45465">GetNodes</a>() { <span class="keywordflow">return</span> nodes; }</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="class_c_element.html#a9c3aa0155a858d271530a462612aad9c">   81</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="class_c_material.html">CMaterial</a>* <a class="code" href="class_c_element.html#a9c3aa0155a858d271530a462612aad9c">GetElementMaterial</a>() { <span class="keywordflow">return</span> ElementMaterial; }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SizeOfStiffnessMatrix() = 0;     </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_c_element.html#a48a18fbde865d6066464516d5a1bfe2f">   86</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_domain.html">CDomain</a>;   <span class="comment">// Allow class Domain to access its protected member</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;};</div><div class="ttc" id="class_c_element_html_a9c3aa0155a858d271530a462612aad9c"><div class="ttname"><a href="class_c_element.html#a9c3aa0155a858d271530a462612aad9c">CElement::GetElementMaterial</a></div><div class="ttdeci">CMaterial * GetElementMaterial()</div><div class="ttdoc">Return material of the element. </div><div class="ttdef"><b>Definition:</b> Element.h:81</div></div>
<div class="ttc" id="class_c_element_html_a1c23c9c0a89413a25271ef4228c3cc56"><div class="ttname"><a href="class_c_element.html#a1c23c9c0a89413a25271ef4228c3cc56">CElement::ND</a></div><div class="ttdeci">unsigned int ND</div><div class="ttdoc">Dimension of the location matrix. </div><div class="ttdef"><b>Definition:</b> Element.h:48</div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
<div class="ttc" id="class_c_element_html_a049aa63089d5133dbf97b9fe8b45986b"><div class="ttname"><a href="class_c_element.html#a049aa63089d5133dbf97b9fe8b45986b">CElement::nodes</a></div><div class="ttdeci">CNode ** nodes</div><div class="ttdoc">Nodes of the element. </div><div class="ttdef"><b>Definition:</b> Element.h:39</div></div>
<div class="ttc" id="_element_8h_html_ad85a06b63ba0fed5a7812531d8ee94c3"><div class="ttname"><a href="_element_8h.html#ad85a06b63ba0fed5a7812531d8ee94c3">clear</a></div><div class="ttdeci">void clear(type *a, unsigned int N)</div><div class="ttdoc">Clear an array. </div><div class="ttdef"><b>Definition:</b> Domain.cpp:21</div></div>
<div class="ttc" id="class_c_element_html"><div class="ttname"><a href="class_c_element.html">CElement</a></div><div class="ttdoc">Element base class. </div><div class="ttdef"><b>Definition:</b> Element.h:31</div></div>
<div class="ttc" id="class_c_skyline_matrix_html"><div class="ttname"><a href="class_c_skyline_matrix.html">CSkylineMatrix&lt; double &gt;</a></div></div>
<div class="ttc" id="class_c_element_html_affc6f37cca3dcee2432f8525c28727ee"><div class="ttname"><a href="class_c_element.html#affc6f37cca3dcee2432f8525c28727ee">CElement::LocationMatrix</a></div><div class="ttdeci">unsigned int * LocationMatrix</div><div class="ttdoc">Location Matrix of the element. </div><div class="ttdef"><b>Definition:</b> Element.h:45</div></div>
<div class="ttc" id="class_c_element_html_ad098d15aca943b13da14ec88fba7aaa5"><div class="ttname"><a href="class_c_element.html#ad098d15aca943b13da14ec88fba7aaa5">CElement::NEN</a></div><div class="ttdeci">unsigned int NEN</div><div class="ttdoc">Number of nodes per element. </div><div class="ttdef"><b>Definition:</b> Element.h:36</div></div>
<div class="ttc" id="_node_8h_html"><div class="ttname"><a href="_node_8h.html">Node.h</a></div></div>
<div class="ttc" id="class_c_material_html"><div class="ttname"><a href="class_c_material.html">CMaterial</a></div><div class="ttdoc">Material base class which only define one data member. </div><div class="ttdef"><b>Definition:</b> Material.h:21</div></div>
<div class="ttc" id="class_c_domain_html"><div class="ttname"><a href="class_c_domain.html">CDomain</a></div><div class="ttdoc">Domain class : Define the problem domain. </div><div class="ttdef"><b>Definition:</b> Domain.h:31</div></div>
<div class="ttc" id="class_c_element_html_a9a13dc46d9eba3a1ecf2677da7d45465"><div class="ttname"><a href="class_c_element.html#a9a13dc46d9eba3a1ecf2677da7d45465">CElement::GetNodes</a></div><div class="ttdeci">CNode ** GetNodes()</div><div class="ttdoc">Return nodes of the element. </div><div class="ttdef"><b>Definition:</b> Element.h:78</div></div>
<div class="ttc" id="class_c_element_html_a1bea8a7fd6a8c1529b7bd41f34bd8edf"><div class="ttname"><a href="class_c_element.html#a1bea8a7fd6a8c1529b7bd41f34bd8edf">CElement::CElement</a></div><div class="ttdeci">CElement()</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> Element.h:53</div></div>
<div class="ttc" id="class_c_element_html_a2a066cabbbfda053188bf43e11794581"><div class="ttname"><a href="class_c_element.html#a2a066cabbbfda053188bf43e11794581">CElement::ElementMaterial</a></div><div class="ttdeci">CMaterial * ElementMaterial</div><div class="ttdoc">Material of the element. </div><div class="ttdef"><b>Definition:</b> Element.h:42</div></div>
<div class="ttc" id="_skyline_matrix_8h_html"><div class="ttname"><a href="_skyline_matrix_8h.html">SkylineMatrix.h</a></div></div>
<div class="ttc" id="class_c_node_html"><div class="ttname"><a href="class_c_node.html">CNode</a></div><div class="ttdoc">Node class. </div><div class="ttdef"><b>Definition:</b> Node.h:19</div></div>
<div class="ttc" id="_material_8h_html"><div class="ttname"><a href="_material_8h.html">Material.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
